AssetSource

abstract class AssetSource(val sourceId: String)

Constructors

Link copied to clipboard
constructor(sourceId: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val credits: AssetCredits? = null

Returns the credits info of this asset source. By default it is null.

Link copied to clipboard
open val license: AssetLicense? = null

Returns the license info of this asset source. By default it is null.

Link copied to clipboard
Link copied to clipboard

Returns the list of supported mime types of the asset source.

Functions

Link copied to clipboard
open fun addAsset(asset: AssetDefinition)

Custom implementation of adding asset to asset source. This method will be invoked when ly.img.engine.AssetApi.addAsset is called for current sourceId.

Link copied to clipboard
open suspend fun applyAsset(asset: Asset): DesignBlock?

Custom implementation of applying asset to the active scene. It is required to override this method only in case the asset needs to be applied differently compared to ly.img.engine.AssetApi.defaultApplyAsset. Implementation can be invoked via ly.img.engine.AssetApi.applyAssetSourceAsset where sourceId should be the sourceId of this AssetSource. If no custom implementation is provided, ly.img.engine.AssetApi.applyAssetSourceAsset will invoke ly.img.engine.AssetApi.defaultApplyAsset instead.

open suspend fun applyAsset(asset: Asset, block: DesignBlock)

Custom implementation of applying asset to an existing block. It is required to override this method only in case the asset needs to be applied differently compared to ly.img.engine.AssetApi.defaultApplyAsset. Implementation can be invoked via ly.img.engine.AssetApi.applyAssetSourceAsset where sourceId should be the sourceId of this AssetSource. If no custom implementation is provided, ly.img.engine.AssetApi.applyAssetSourceAsset will invoke ly.img.engine.AssetApi.defaultApplyAsset instead.

Link copied to clipboard
open suspend fun applyAssetProperty(asset: Asset, property: AssetProperty)

Custom implementation of applying asset properties to the active scene. It is required to override this method only in case a property needs to be applied. Implementation can be invoked via ly.img.engine.AssetApi.applyAssetSourceProperty where sourceId should be the sourceId of this AssetSource.

Link copied to clipboard
open suspend fun fetchAsset(id: String, options: FetchAssetOptions = FetchAssetOptions()): Asset?

Fetches an asset from the asset source. Implementation of this method is required to use ly.img.engine.AssetApi.fetchAsset. By default returns null.

Link copied to clipboard
abstract suspend fun findAssets(query: FindAssetsQuery): FindAssetsResult

Searches assets based on the query.

Link copied to clipboard
abstract suspend fun getGroups(): List<String>?

Specifies all the available groups in this asset source.

Link copied to clipboard
open fun removeAsset(assetId: String)

Custom implementation of removing asset from asset source. This method will be invoked when ly.img.engine.AssetApi.removeAsset is called for current sourceId.